import Vue from 'vue'
import Router from 'vue-router'
import Home from 'components/home.vue'
import homeIndex from 'components/main/homeIndex.vue'
import AddTag from 'components/makeTag/AddTag.vue'
import ListTag from 'components/makeTag/ListTag.vue'
import TagManagement from 'components/makeTag/TagManagement.vue'


Vue.use(Router)

export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        auth: true,
        title: 'Login - 登录'
    },
    component: resolve => { require(['components/login/login'], resolve); }
};
export const page404 = {
    path: '/*',
    name: 'error-404',
    meta: {
        title: '404-页面不存在'
    },
    component: resolve => { require(['components/errorPage/404.vue'], resolve); }
};

export const mainRouter = {
    path: '/',
    name: 'mainRouter',
    redirect: '/login',
    component: Home,
    children: [{
            path: '/home',
            is_nav: true,
            title: '首页',
            name: 'home_index',
            icon: 'home',
            component: homeIndex,
            children: []
        },
        // { path: '/callConfirm', is_nav: true, title: '语音客服', name: 'callconfirm_index', icon: 'android-call', component: resolve => { require(['components/voiceCall/callConfirm.vue'], resolve); }, children: [], meta: { keepAlive: true } },
        // { path: '/callConfirm', is_nav: true, title: '语音客服', name: 'voicecall_index', icon: 'android-call', component: resolve => { require(['components/voiceCall/voiceCall.vue'], resolve); }, children: [], meta: { keepAlive: true } },
        // { path: '/voicecall', is_nav: false, title: '呼叫弹屏', name: 'voicecall_index', icon: 'android-call', component: resolve => { require(['components/voiceCall/voiceCall.vue'], resolve); }, children: [], meta: { keepAlive: true } },
        // { path: '/voicecall', is_nav: false, title: '呼叫弹屏', name: 'callconfirm_index', icon: 'android-call', component: resolve => { require(['components/voiceCall/voiceCall.vue'], resolve); }, children: [], meta: { keepAlive: true } },
        { path: '/addCallConfirm', is_nav: false, title: '语音客服', name: 'callconfirm_index', icon: 'android-call', component: resolve => { require(['components/voiceCall/addCallConfirm.vue'], resolve); }, children: [], meta: { keepAlive: true } },
        { path: '/taskmine', is_nav: true, title: '我的工单', name: 'taskmine_index', icon: 'android-document', component: resolve => { require(['components/task/taskMine.vue'], resolve); }, children: [] },
        { path: '/taskuntreated', is_nav: true, title: '待处理工单', name: 'taskuntreated_index', icon: 'ios-compose', component: resolve => { require(['components/task/taskUntreated.vue'], resolve); }, children: [] },
        { path: '/taskpending', is_nav: true, title: '待分配工单', name: 'taskpending_index', icon: 'social-codepen', component: resolve => { require(['components/task/taskPending.vue'], resolve); }, children: [] },
        { path: '/taskmanage', is_nav: true, title: '工单管理', name: 'taskmanage_index', icon: 'ios-bookmarks', component: resolve => { require(['components/task/taskManage.vue'], resolve); }, children: [] },
        { path: '/record', is_nav: true, title: '我的记录', name: 'record_index', icon: 'ios-rose', component: resolve => { require(['components/record/ownrecord.vue'], resolve); }, children: [] },
        { path: '/ownannouncement', is_nav: true, title: '我的公告', name: 'ownannouncement_index', icon: 'android-clipboard', component: resolve => { require(['components/announcement/ownannouncement.vue'], resolve); }, children: [] },
        { path: '/announcementmanage', is_nav: true, title: '公告管理', name: 'announcementmanage_index', icon: 'android-list', component: resolve => { require(['components/announcement/announcementmanage.vue'], resolve); }, children: [] },
        { path: '/wordoperation', is_nav: true, title: '话术管理', name: 'wordoperation_index', icon: 'merge', component: resolve => { require(['components/wordoperation/wordoperation.vue'], resolve); }, children: [] },
        { path: '/taskdetail', is_nav: false, title: '工单详情', name: 'taskdetail_index', component: resolve => { require(['components/task/taskDetail.vue'], resolve); }, children: [] },
        {
            path: '/TagManagement',
            is_nav: true,
            title: '标签管理',
            name: 'Tag_Management',
            icon: 'ios-pricetags-outline',
            component: TagManagement,
            children: []
        },
        {
            path: '/AddTag',
            is_nav: true,
            title: '添加标签',
            name: 'Add_Tag',
            icon: 'ios-pricetags-outline',
            component: AddTag,
            children: []
        },
        {
            path: '/ListTag',
            is_nav: true,
            title: '标签列表',
            name: 'List_Tag',
            icon: 'ios-pricetags-outline',
            component: ListTag,
            children: []
        },
        { path: '/repository', is_nav: false, title: '知识库', name: 'repository_index', icon: 'link', component: resolve => { require(['components/repository/repository.vue'], resolve); }, children: [] },
    ]
};

export default new Router({
    routes: [
        loginRouter,
        mainRouter,
        page404
    ]
});